package com.example.gongj;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

/**
 * 指定编码写出
 */
public class OutputStreamWriterDemo {
    public static void main(String[] args) throws Exception {
        FileOutputStream os = new FileOutputStream("IO流\\GBK.txt");
        OutputStreamWriter osw = new OutputStreamWriter(os,"GBK");
        osw.write("我好棒棒哦");
        osw.flush();
        osw.close();
    }
}
